#!/usr/bin/python
import os,sys,re

def filename(url):
	if re.search('[^/]+$',url)==None: # file name not found
		raise Exception('%s contains no filename.'%url)
	return re.search('[^/]+$',url).group(0)
